package com.aner.test.controller;
import com.aner.tester.controller.BaseControllerTest;
import org.junit.Test;
import org.junit.runner.RunWith;
import com.aner.tester.utils.text.StringUtils;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;


/**
 * DeleteTestControllerTest class
 * 
 * @author aner
 * @date 2020-12-30
 */
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@RunWith(SpringRunner.class)
@AutoConfigureMockMvc
public class DeleteTestControllerTest extends BaseControllerTest
{

    @Test
    public void testTest() {
        String params = "{'booleanTest':true,'byteTest':1,'dateTest':'2020-12-30 13:39:02','doubleTest':0.26824125383237296,'floatTest':0.4891863,'intTest':1,'longTest':1,'stringTest':'猫小事公的'}";
        String jsonStr = StringUtils.replaceSingleQuoteWithDouble(params);
                    this.delete("/test/", jsonStr);
        
    }
    @Test
    public void testRequestParamDateTest() {
        String params = "{'testDate':'2020-12-30 13:39:02'}";
        String jsonStr = StringUtils.replaceSingleQuoteWithDouble(params);
                    this.delete("/testRequestParamDate/", jsonStr);
        
    }
    @Test
    public void testRequestBodyDateTest() {
        String params = "1609306742246";
        String jsonStr = StringUtils.replaceSingleQuoteWithDouble(params);
                    this.deleteBody("/testRequestBodyDate/", jsonStr);
        
    }
    @Test
    public void testRequestBodyListTest() {
        String params = "['猫个事四0的','猫小三狗','3小安','三狗广小','故的小小','2猫']";
        String jsonStr = StringUtils.replaceSingleQuoteWithDouble(params);
                    this.deleteBody("/testRequestBodyList/", jsonStr);
        
    }
    @Test
    public void testRequestParamListTest() {
        String params = "{'testList':['0狗猫事小小','4三1公狗3']}";
        String jsonStr = StringUtils.replaceSingleQuoteWithDouble(params);
                    this.delete("/testRequestParamList/", jsonStr);
        
    }
    @Test
    public void testRequestBodyMapTest() {
        String params = "{'31第5小猪':'020','的4第司':'521','个安':'896'}";
        String jsonStr = StringUtils.replaceSingleQuoteWithDouble(params);
                    this.deleteBody("/testRequestBodyMap/", jsonStr);
        
    }
    @Test
    public void testRequestBodyLongTest() {
        String params = "0";
        String jsonStr = StringUtils.replaceSingleQuoteWithDouble(params);
                    this.deleteBody("/testRequestBodyLong/", jsonStr);
        
    }
    @Test
    public void testPathVariableTest() {
        String params = "{'params':['猪的的','5四个小','公事0司司0','东告3猫4小'],'id':[3,2,3]}";
        String jsonStr = StringUtils.replaceSingleQuoteWithDouble(params);
                    this.delete("/testPathVariable/{params}/{id}", jsonStr);
        
    }
    @Test
    public void testDateTest() {
        String params = "{'test':'2020-12-30 13:39:02'}";
        String jsonStr = StringUtils.replaceSingleQuoteWithDouble(params);
                    this.delete("/testDate/", jsonStr);
        
    }
    @Test
    public void testBodyTest() {
        String params = "{'booleanTest':true,'byteTest':1,'dateTest':'2020-12-30 13:39:02','doubleTest':0.17731440296891188,'floatTest':0.6559848,'intTest':1,'longTest':0,'strArray':['广猪1广','个司','2东','安个','个猫司的事','第三小司'],'stringList':['故司小事告故','小安','3猫3猫事','小广的猪','狗三广三5狗','的小'],'stringTest':'猫猫54','testObjectArray':[{'booleanTest':true,'byteTest':0,'dateTest':'2020-12-30 13:39:02','doubleTest':0.8704331419219632,'floatTest':0.6827255,'intTest':0,'longTest':3,'stringTest':'事四5尔'},{'booleanTest':false,'byteTest':1,'dateTest':'2020-12-30 13:39:02','doubleTest':0.9348559098320375,'floatTest':0.5130084,'intTest':0,'longTest':2,'stringTest':'告小猪'},{'booleanTest':false,'byteTest':0,'dateTest':'2020-12-30 13:39:02','doubleTest':0.2568703418447985,'floatTest':0.39502352,'intTest':1,'longTest':3,'stringTest':'第狗52猫'},{'booleanTest':false,'byteTest':0,'dateTest':'2020-12-30 13:39:02','doubleTest':0.10520307319345679,'floatTest':0.9825783,'intTest':1,'longTest':0,'stringTest':'的安东'},{'booleanTest':true,'byteTest':1,'dateTest':'2020-12-30 13:39:02','doubleTest':0.5147663143837043,'floatTest':0.021533072,'intTest':1,'longTest':0,'stringTest':'2尔'}],'testObjectList':[{'booleanTest':true,'byteTest':1,'dateTest':'2020-12-30 13:39:02','doubleTest':0.2293064963620095,'floatTest':0.23449099,'intTest':0,'longTest':0,'stringTest':'四司省告小广'},{'booleanTest':true,'byteTest':1,'dateTest':'2020-12-30 13:39:02','doubleTest':0.4792685505519375,'floatTest':0.7114521,'intTest':0,'longTest':3,'stringTest':'小0个3的小'},{'booleanTest':false,'byteTest':0,'dateTest':'2020-12-30 13:39:02','doubleTest':0.11627912736000712,'floatTest':0.57264745,'intTest':0,'longTest':2,'stringTest':'小小个猫省'},{'booleanTest':false,'byteTest':1,'dateTest':'2020-12-30 13:39:02','doubleTest':0.3364492822449475,'floatTest':0.09612107,'intTest':1,'longTest':1,'stringTest':'四个小狗50'},{'booleanTest':false,'byteTest':0,'dateTest':'2020-12-30 13:39:02','doubleTest':0.9308176898352487,'floatTest':0.55083954,'intTest':0,'longTest':2,'stringTest':'事小故'}],'testObjectMap':{'广5司的故':'77763','5猫':'251'}}";
        String jsonStr = StringUtils.replaceSingleQuoteWithDouble(params);
                    this.deleteBody("/testRequestBody/", jsonStr);
        
    }
}
